﻿// *----------------------------------------------------------------
// Copyright (C) 2017 通通优品
// 版权所有。
// 
// 类名：ICachingConfiguration.cs
// 功能描述：TongTongMall
// 
// Create User：jym 2017/02/09
// 
// Edit User：UserName,EditTime
// Describe：Describe
// ----------------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TongTongMall.Configuration.Startup;

namespace TongTongMall.Runtime.Caching.Configuration
{
    public interface ICachingConfiguration
    {
        /// <summary>
        /// 启动配置项
        /// </summary>
        IStartupConfiguration Configuration { get; }

        /// <summary>
        /// 缓存配置项
        /// </summary>
        IReadOnlyList<ICacheConfigurator> Configurators { get; }

        /// <summary>
        /// 加载全部的缓存初始化方法
        /// </summary>
        /// <param name="initAction"></param>
        void ConfigureAll(Action<ICache> initAction);

        /// <summary>
        /// 根据缓存名称执行缓存配置初始化方法
        /// </summary>
        /// <param name="cacheName"></param>
        /// <param name="initAction"></param>
        void Configure(string cacheName, Action<ICache> initAction);
    }
}
